import  request  from "../utils/request"

const getCateGory = ()=>{
    return  request.get('/api/admin/category')
}
// 修改分类状态

const changeStatus = (categoryId)=>{
    return request.patch(`/api/admin/category/${categoryId}/status`)
}

// 获取当前分类详情
const getCateDetail = (categoryId)=>{
    return request.get(`/api/admin/category/${categoryId}`)
}
// 编辑当前分类
const editCategory  = (cateGoryId,editForm)=>{
    return request.put(`/api/admin/category/${cateGoryId}`,editForm)
}

// 添加分类
const addCategory = (addForm)=>{
    return request({
        method:'POST',
        url:'/api/admin/category',
        data:addForm
    })
}

export {
    getCateGory,
    changeStatus,
    getCateDetail,
    editCategory,
    addCategory
}